<?php

/**
 * Inscription form base class.
 *
 * @method Inscription getObject() Returns the current form's model object
 *
 * @package    tfe
 * @subpackage form
 * @author     3emeIG
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseInscriptionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'id_contact'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'), 'add_empty' => true)),
      'id_groupe'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Groupe'), 'add_empty' => true)),
      'parent'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Parent'), 'add_empty' => true)),
      'prix'             => new sfWidgetFormInputText(),
      'mode_de_paiement' => new sfWidgetFormChoice(array('choices' => array('' => '', 'liquide' => 'liquide', 'virement' => 'virement', 'carte' => 'carte', 'chèque' => 'chèque'))),
      'date_de_paiement' => new sfWidgetFormDate(),
      'code_de_paiement' => new sfWidgetFormInputText(),
      'validee'          => new sfWidgetFormInputCheckbox(),
      'annulee'          => new sfWidgetFormInputCheckbox(),
      'expiree'          => new sfWidgetFormInputCheckbox(),
      'a_rembourser'     => new sfWidgetFormInputCheckbox(),
      'remboursee'       => new sfWidgetFormInputCheckbox(),
      'commentaire'      => new sfWidgetFormTextarea(),
      'deleted_at'       => new sfWidgetFormDateTime(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'id_contact'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'), 'required' => false)),
      'id_groupe'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Groupe'), 'required' => false)),
      'parent'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Parent'), 'required' => false)),
      'prix'             => new sfValidatorNumber(),
      'mode_de_paiement' => new sfValidatorChoice(array('choices' => array(0 => '', 1 => 'liquide', 2 => 'virement', 3 => 'carte', 4 => 'chèque'), 'required' => false)),
      'date_de_paiement' => new sfValidatorDate(array('required' => false)),
      'code_de_paiement' => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'validee'          => new sfValidatorBoolean(array('required' => false)),
      'annulee'          => new sfValidatorBoolean(array('required' => false)),
      'expiree'          => new sfValidatorBoolean(array('required' => false)),
      'a_rembourser'     => new sfValidatorBoolean(array('required' => false)),
      'remboursee'       => new sfValidatorBoolean(array('required' => false)),
      'commentaire'      => new sfValidatorString(array('required' => false)),
      'deleted_at'       => new sfValidatorDateTime(array('required' => false)),
      'created_at'       => new sfValidatorDateTime(),
      'updated_at'       => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('inscription[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Inscription';
  }

}
